#include <stdio.h>

int main(void){
  unsigned int value = 0;
  value = getchar();
  printf("%d",(value & 1));
  return 0;
}
